package com.couldsail.takeaway.controller.general;

import com.couldsail.takeaway.common.result.Result;
import com.couldsail.takeaway.pojo.vo.ShopVO;
import com.couldsail.takeaway.service.ShopService;
import com.couldsail.takeaway.utils.AddressLocationUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@RestController("generalAddressController")
@RequestMapping("/general/address")
@Api(tags = "通用接口")
@RequiredArgsConstructor
@CrossOrigin(origins = "*")
public class generalAddressController {
    @ApiOperation("获取地址经纬度")
    @GetMapping("/detail")
    public Result<String> getById(String address) {
        log.info("获取地址经纬度地址：{}",address);
        return Result.success(AddressLocationUtil.getLonAndLatByAddress(address));
    }
} 